package friendofmine

  
 
class Membre {
	
	String login,password,prenom, nom, sexe,email
	Date datenaissance
	 
	
	static hasMany = [phototaggees: PhotoTaggee,passions:Interet, amis: Membre]
	 
    static mappedBy = [amis: 'amis']
	
	//def authenticationService
    static constraints = {		
		login blank:false , nullable: true, unique:true
		prenom blank:false
		nom blank:false
		password size: 5..15, blank: false
		sexe inList:["M","F"]
		email email:true, blank:false, unique:true
		datenaissance max:  new Date().minus(4745)
		
		
		//datenaissance max: 18.years.ago  as Date
	//	datenaissance max:  18.years.ago.toDate()
	//	phototaggee size:[0..5000]
		
	}
	String toString() {"${prenom} ${nom}"}
	//def addToAmis()
}
